#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main(int argc,char * argv[])
{
    int data_porcessed;
    char buffer[BUFSIZ + 1];
    int file_descriptor;

    memset(buffer,'\0',sizeof(buffer));
    sscanf(argv[1],"%d",&file_descriptor);
    data_porcessed = read(file_descriptor,buffer,BUFSIZ);
    printf("%d - read %d bytes:%s\n",getpid(),data_porcessed,buffer);
//    sleep(1);
 //   data_porcessed = read(file_descriptor,buffer,BUFSIZ);

    printf("%d - read %d bytes:%s\n",getpid(),data_porcessed,buffer);
    printf("pip4 exit\n");
    exit(EXIT_SUCCESS);


}
